package com.yanqu.road.server.cmd.taobao;

import com.yanqu.road.pb.taobao.TaoBao;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.taobao.TaoBaoModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_TAOBAO_DEAL, desc = "")
public class TaobaoDealCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
       ret =  player.getModule(TaoBaoModule.class).deal();
        if (ret != 0) {
            TaoBao.TaoBaoDealRespMsg.Builder msg = TaoBao.TaoBaoDealRespMsg.newBuilder();
            msg.setRet(ret);
            player.sendPacket(ClientProtocol.U_TAOBAO_DEAL, msg);
        }
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
